Day 2: Branching, Merging and collaboration workflows
September 19, 2023
Did everyone accept a collaboration invitation?
Basic Git workflow:
Basic Git workflow:
Git is a distributed version control system
Clone your team mate’s cook Book repo (File -> Clone repository)
It should be in the list of your repositories if you accepted the invitation.
git pushgit pullThis works well if
This workflow starts to be problematic when
Get the changes of your team mate from the remote.
The steps to create and work on a separate branch are easy:
To bring changes to the main branch you need to merge them.
Normally: Git merge brings the commits from the branch to main
To bring changes to the main branch you need to merge them.
If there was a commit on a common file in main, a merge commit is introduced.
To bring changes to the main branch you need to merge them.
Merge conflicts need to be solved manually. You need to chose which of the conflicting versions you want to keep.
Create a branch and merge it in your team mate’s cook book
Complete task 2 “Branch and merge” (10 min)
A pull request is basically asking your collaborators:
What do you think of my changes? Can we integrate them in main or do we still need to change something?
Github has nice features for pull requests:
A pull request is merged on Github when everyone agreed on the code.
Create a pull request on your partners repo
Complete task 3 “Pull requests” (10 min)
Questions?
Monday 2.30 - 3.30 on Webex (link via email)
Until then: work with Git on your own (~ 1 - 2 h)
Collect questions/problems/discoveries
More Git topics
Branching, Merging and Collaboration with Git